<!doctype html>
<html  class="x-admin-sm">
<head>
	<meta charset="UTF-8">
	<title>登录</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/static/common/layui/css/layui.css"/>
    <link rel="stylesheet" href="/static/common/css/login.css" media="all">
    <style>
        body {
            background-image: url("common/images/bg_login2.svg");
            background-position: center 110px;
            background-repeat: no-repeat;
            background-size: 100%;
            background-color: #f0f2f5;
        }
        .login-header {
            color: rgba(0, 0, 0, .85) !important;
        }
        .login-footer {
            color: rgba(0, 0, 0, 0.7) !important;
        }
        .login-footer a {
            color: rgba(0, 0, 0, 0.7) !important;
        }
        .login-footer a:hover {
            color: rgba(0, 0, 0, 0.4) !important;
        }
    </style>
</head>
<body>

<div class="login-wrapper">
    <div class=" login-body">
        <div class="layui-card">
            <div class="layui-card-header">
                <i class="layui-icon layui-icon-engine"></i>&nbsp;&nbsp;用户登录
            </div>
            <form class="layui-card-body layui-form layui-form-pane">
                <div class="layui-form-item">
                    <label class="layui-form-label">用户名</label>
                    <div class="layui-input-block">
                        <input name="empName" type="text" lay-verify="required" class="layui-input" value="admin">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">密码</label>
                    <div class="layui-input-block">
                        <input name="pwd" type="password" lay-verify="required" class="layui-input" value="123456">
                    </div>
                </div>
                <div class="layui-form-item" pane="">
                    <label class="layui-form-label" lay-tips="7天内免登陆">记住我</label>
                    <div class="layui-input-block">
                        <input type="radio" name="remember" value="on" title="是">
                        <input type="radio" name="remember" value="off" title="否" checked="">
                    </div>
                </div>
                <div class="layui-form-item">
                    <a href="javascript:;" class="layui-link">帐号注册</a>
                    <a href="javascript:;" class="layui-link pull-right">忘记密码？</a>
                </div>
                <div class="layui-form-item">

                    <input class="layui-btn layui-btn-fluid" value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit">
                </div>
                <div class="layui-form-item login-other">
                    <label>第三方登录</label>
                    <a href="javascript:;"><i class="layui-icon layui-icon-login-qq"></i></a>
                    <a href="javascript:;"><i class="layui-icon layui-icon-login-wechat"></i></a>
                    <a href="javascript:;"><i class="layui-icon layui-icon-login-weibo"></i></a>
                </div>
            </form>
        </div>
    </div>
    <div class="login-footer">
        <p>© 2020 <a href="https://www.stylefeng.cn" target="_blank">Yday</a></p>
    </div>
</div>
    <script type="text/javascript" src="/static/common/plugins/jquery/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" src="/static/common/layui/layui.js"></script>
    <script type="text/javascript" src="/static/common/js/map.js"></script>
    <script>
        $(function  () {
            layui.use('form', function(){
              var form = layui.form;
              //监听提交
              form.on('submit(login)', function(data){
                  $.ajax({
                      type: "post",
                      /*请求方法*/
                      url: "/doLogin",
                      /*请求的url*/

                      data: JSON.stringify(data.field),
                      /*username=xxx&password=xxx*/
                      contentType : "application/json;charsetset=UTF-8",//必须
                      dataType: "JSON",         //必须
                      /*服务器返回的数据格式*/
                      success: function(data) { /*请求成功后的回调函数。data是服务器返回的数据*/
                          if(data.code == "ok") {0
                              layer.msg("登录成功！");
                              location.href='/'
                          } else {
                              layer.msg("登录失败！"+data.code);
                          }
                      },
                      error: function() { /*error 在请求出错时调用*/
                          alert("请求失败.....");
                      },
                      timeout: 6000
                      /*设置请求超时时间（毫秒）*/
                  });

                return false;
              });
            });
        })
    </script>
    <!-- 底部结束 -->
    <script>
    //百度统计可去掉
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
      var s = document.getElementsByTagName("script")[0]; 
      s.parentNode.insertBefore(hm, s);
    })();
    </script>
</body>
</html>